package cn.internship.modules.manage.service.impl;

import cn.internship.modules.manage.entity.dto.ReportSearch;
import cn.internship.modules.manage.entity.vo.ReportList;
import cn.internship.modules.manage.entity.vo.WeeklyRecordList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.internship.common.utils.PageUtils;
import cn.internship.common.utils.Query;

import cn.internship.modules.manage.dao.InternshipReportDao;
import cn.internship.modules.manage.entity.InternshipReportEntity;
import cn.internship.modules.manage.service.InternshipReportService;


@Service("internshipReportService")
public class InternshipReportServiceImpl extends ServiceImpl<InternshipReportDao, InternshipReportEntity> implements InternshipReportService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<InternshipReportEntity> page = this.page(
                new Query<InternshipReportEntity>().getPage(params),
                new QueryWrapper<InternshipReportEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PageUtils listByPage(ReportSearch search) {
        Page<ReportList> page=new Page<>(search.getPage(),search.getLimit());
        this.baseMapper.queryList(page,search);
        return  new PageUtils(page);
    }

}